A magnetic compass is typically integrated with other components that distort the Earth's magnetic field, thereby compromising the accuracy of the compass. These disturbances are usually corrected with a field compensation mechanism that determines compensation coefficients to correct magnetic field readings. The quality of the compensation coefficients depends on the data set of magnetic field samples taken, which typically spans 3D space with sufficient variation in orientation of the samples. These methods may require a user to perform tedious and time consuming tasks such as holding the device steady in several orientations while the data is collected, moving the device in a predetermined manner, or manually selecting the data. Manually inputting data is often cumbersome as typical embedded applications have few user interface elements for user input. Furthermore, a large memory capacity can be required to store sufficient data samples in embedded applications where small size is often a premium.